<script type="text/javascript">
function sendmsg() {
	var valid = true;
	if($j('#firstname').val() == "") { $j('#firstname').css('background','#fff3a0'); valid = false; }
	else { $j('#firstname').css('background','#fff'); }
	if($j('#familyname').val() == "") { $j('#familyname').css('background','#fff3a0'); valid = false; }
	else { $j('#familyname').css('background','#fff'); }
	if($j('#storeno').val() == "") { $j('#storeno').css('background','#fff3a0'); valid = false; }
	else { $j('#storeno').css('background','#fff'); }
	/*
	if($j('#email').val() == "") { $j('#email').css('background','#fff3a0'); valid = false; }
	else 
	{ 
	  if(!echeck($j('#email').val()))
		{
			$j('#email').css('background','#fff3a0'); 
	        valid = false;
		}
		else
		{
			$j('#email').css('background','#fff');
		} 
	 
	}*/
	if($j('#msg').val() == "") { $j('#msg').css('background','#fff3a0'); valid = false; }
	else { $j('#msg').css('background','#fff'); }
	if (valid) 
	{
		document.contactForm.submit();
	}
}
function subscribe() {
	var valid = true;
	if($j('#firstname2').val() == "") { $j('#firstname2').css('background','#fff3a0'); valid = false; }
	else { $j('#firstname2').css('background','#fff'); }
	if($j('#familyname2').val() == "") { $j('#familyname2').css('background','#fff3a0'); valid = false; }
	else { $j('#familyname2').css('background','#fff'); }
	
	if($j('#email2').val() == "") { $j('#email2').css('background','#fff3a0'); valid = false; }
	else 
	{ 
	  if(!echeck($j('#email2').val()))
		{
			$j('#email2').css('background','#fff3a0'); 
	        valid = false;
		}
		else
		{
			$j('#email2').css('background','#fff');
		} 
	}
	if (valid) 
	{
		document.subscribeForm.submit();
	}
}
function echeck(str) {

                var at = "@"
                var dot = "."
                var lat = str.indexOf(at)
                var lstr = str.length
                var ldot = str.indexOf(dot)
                if (str.indexOf(at) == -1) {
                    alert("Please Enter A Valid E-mail")
                    return false
                }

                if (str.indexOf(at) == -1 || str.indexOf(at) == 0 || str.indexOf(at) == lstr) {
                    alert("Please Enter A Valid E-mail")
                    return false
                }

                if (str.indexOf(dot) == -1 || str.indexOf(dot) == 0 || str.indexOf(dot) == lstr) {
                    alert("Please Enter A Valid E-mail")
                    return false
                }

                if (str.indexOf(at, (lat + 1)) != -1) {
                    alert("Please Enter A Valid E-mail")
                    return false
                }

                if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot) {
                    alert("Please Enter A Valid E-mail")
                    return false
                }

                if (str.indexOf(dot, (lat + 2)) == -1) {
                    alert("Please Enter A Valid E-mail")
                    return false
                }

                if (str.indexOf(" ") != -1) {
                    alert("Please Enter A Valid E-mail")
                    return false
                }


                return true;
            }
</script>
<div id="store">
   <div class="page-header"><div>Contact</div></div>
   <div class="page-content" style="padding-right:0">
     <table cellpadding="0" cellspacing="0" border="0">
       <tr>
        <td width="460">
          <div style="width:755px;padding:10px;">
            <p class="sub-header">7-Eleven Support Contact</p><br/>
            <p>The 7 Eleven online merchandise store is here to help. If you have any questions please contact us via the email support form below.</p>
            <p>The 7-Eleven support centre will be in contact to assist you with any questions you may have.</p><br/>
            <p class="italic-text">* Denotes Required Field</p><br/>
           <div style="width:450px;border-top:1px solid #e5e5e5;padding-top:6px">
            <form name="contactForm" method="post" action="<?=base_url()?>sendmsg">
            <?php if($this->session->flashdata('send_msg'))
			{
				echo $this->session->flashdata('send_msg');
			}
			?>
            <table cellpadding="0" cellspacing="0" border="0" width="430">
                         <tr height="38">
                           <td>First Name *</td><td><input type="text" name="firstname" id="firstname" style="width:280px;border:1px solid #e5e5e5;" /></td>
                         </tr>
                         <tr height="38"><td>Family Name *</td><td><input type="text" name="familyname" id="familyname" style="width:280px;border:1px solid #e5e5e5;" /></td></tr>
                         <tr height="38"><td width="140">Store Number *</td><td><input type="text" name="storeno" id="storeno" style="width:280px;border:1px solid #e5e5e5;" /></td></tr>
                        <!-- <tr height="38"><td>Your Email *</td><td><input type="text" name="email" id="email" style="width:280px;border:1px solid #e5e5e5;" /></td></tr>-->
                        <tr height="38"><td>Phone Number</td><td><input type="text" name="phone" id="phone" style="width:280px;border:1px solid #e5e5e5;" /></td></tr>
                         <tr height="50">
                <td>Message *</td><td><textarea  rows="4" style="width:290px;border:1px solid #e5e5e5; color: #666; font-family:Arial, Helvetica, sans-serif; font-size:12px;" name="msg" id="msg" /></textarea></td>
              </tr>
                <tr height="40"><td>&nbsp;</td><td align="right"><div class="button" onclick="sendmsg()"><div>Send</div></div></td></tr>
                </table>
             
            </form>
           </div>
          </div>
       </td>
     <!-- <td valign="top">
        <div style="padding-left:14px">
           <p class="sub-header">Feel Free</p><br/>
            <p>To contact us for any reason be it technical support, site improvements, stock levels, upcoming sales or any other question you may have about the 7 Eleven Online Merchandise Store.</p><br/>
            <p class="italic-text">* Denotes Required Field</p><br/>
            <div style="width:404px;border-top:1px solid #e5e5e5;padding-top:6px">
            <form name="subscribeForm" method="post" action="<?php echo base_url()?>subscribe">
            <table cellpadding="0" cellspacing="0" border="0" width="404">
                         <tr height="38">
                           <td>First Name *</td><td><input type="text" name="firstname2" id="firstname2" style="width:280px;border:1px solid #e5e5e5;" /></td>
                         </tr>
                         <tr height="38"><td>Family Name *</td><td><input type="text" name="familyname2" id="familyname2" style="width:280px;border:1px solid #e5e5e5;" /></td></tr>
                         <tr height="38"><td width="140">Mobile Number</td><td><input type="text" name="mobile" id="mobile" style="width:280px;border:1px solid #e5e5e5;" /></td></tr>
                         <tr height="38"><td>Your Email *</td><td><input type="text" name="email2" id="email2" style="width:280px;border:1px solid #e5e5e5;" /></td></tr>
                       
                <tr height="40"><td>&nbsp;</td><td align="right"><div class="button" onclick="subscribe()"><div>Subscribe</div></div></td></tr>
                </table>
             
            </form>
           </div>
        </div>
     </td> -->
    </tr>
  </table>
 </div>
</div>